package com.gxuwz.stats.entity;

import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.NoArgsConstructor;

import javax.persistence.Column;

@Builder
@AllArgsConstructor(access = AccessLevel.PUBLIC) // 强制生成 public 构造器
@TableName("rsp_user")
public class User {

    @TableId(type = IdType.AUTO)
    private Integer userId;
    @Column(name = "username")
    @ExcelProperty(value = "姓名")
    private String username;
    @Column(name = "password")
    private String password;

    @Column(name = "role")
    private String role;
    @Column(name = "degree")
    @ExcelProperty(value = "学位")
    private String degree;
    @Column(name = "position")
    @ExcelProperty(value = "职称")
    private String position;
    @Column(name = "post")
    @ExcelProperty(value = "职务")
    private String post;
    @Column(name = "department")
    @ExcelProperty(value = "部门")
    private String department;

    @TableField(exist = false)
    private String code;

    @TableField(exist = false)
    private String captchaKey; // 验证码唯一标识符

    public User() {

    }

    public String getCaptchaKey() {
        return captchaKey;
    }

    public void setCaptchaKey(String captchaKey) {
        this.captchaKey = captchaKey;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getRole() {
        return role;
    }

    public void setRole(String role) {
        this.role = role;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDegree() {
        return degree;
    }

    public void setDegree(String degree) {
        this.degree = degree;
    }

    public String getPosition() {
        return position;
    }

    public void setPosition(String position) {
        this.position = position;
    }

    public String getPost() {
        return post;
    }

    public void setPost(String post) {
        this.post = post;
    }

    public String getDepartment() {
        return department;
    }

    public void setDepartment(String department) {
        this.department = department;
    }



    @Override
    public String toString() {
        return "User{" +
                "userId=" + userId +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", role='" + role + '\'' +
                ", degree='" + degree + '\'' +
                ", position='" + position + '\'' +
                ", post='" + post + '\'' +
                ", department='" + department + '\'' +
                ", code='" + code + '\'' +
                '}';
    }
}

